/**
 * 
 */
package jvs.peer.io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 
 * Delete the file after stream is closed
 * 
 * @author qiangli
 *
 */
public class DeleteFileOutputStream extends FileOutputStream {
	private File file;
	
	public DeleteFileOutputStream(File file) throws FileNotFoundException {
		super(file);
		this.file = file;
	}

	@Override
	public void close() throws IOException {
		super.close();
		file.delete();
	}

}
